import request from '@/utils/request'




const api_name = "/admin/system/sysRole"

export function assginRoleMenu(assginMenuDto) {

    return request({
        url: `/admin/system/sysRoleMenu/modifySysRoleMenu`,
        method: 'PUT',
        data :assginMenuDto
    })
}
export function deleteSysRole(sysRole) {
    return request({
        url: `${api_name}/deleteSysRole`,
        method: 'DELETE',
        data :sysRole
    })

}



export function findSysRoleMenuByRoleId(rolId) {
    return request({
        url: `/admin/system/sysRoleMenu/findSysRoleMenuByRoleId/${rolId}`,
        method:"GET",
    })
}

//分页查询角色
export const getRoleByPage = (formInline)=>{
    return request({
        url: `${api_name}/findByPage/${formInline.pageNum}/${formInline.pageSize}`,
        method: 'get',
        params: {roleName:formInline.roleName},
    })
}

export  const saveRole = (sysRole)=>{
    return request({
        url: `${api_name}/saveSysRole`,
        method: 'post',
        data: sysRole,
    })
}
export function updateSysRole(sysRole) {
    return request({
        url: `${api_name}/upDateSysRole`,
        method: 'put',
        data: sysRole,
    })
}

export const getAllRole = ()=>{
    return request({
        url: `${api_name}/getAllRole`,
        method: 'get'
    })
}